﻿@model WebChat.Models.aspnet_User
@{
    ViewBag.Title = "Endre";
}
<h2>
    Endre</h2>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/tooltip.js")"></script>
<div style="display: none; position: absolute; z-index: 110; left: 400; top: 100;
    width: 15; height: 15" id="preview_div">
</div>
@using (Html.BeginForm("../User/EditUser/"+@Model.UserId, "UserController", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>@Model.UserName</legend>
        <div class="editor-label">
            <h3>
                Avatar</h3>
        </div>
        <img height="140" width="140" id="img" src="@Url.Action("Image", "Message", new { id = Model.imageId })" alt="my image" onmouseover="showtrail(800, 600,'@Url.Action("Image", "Message", new { id = Model.imageId })')" onmouseout="hidetrail()" />
        <br />
        <label for="file">Last opp nytt avatar(maks 1Mb):</label>
        <input type="file" name="file" id="file" />
        @Html.ValidationMessageFor(model => model.imageId)

        <div class="editor-label">
            <h3>
                Mobil nr. (Første to tall skal være landskode. Norge har 47.)</h3>
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MobilePhoneNumber)
            @Html.ValidationMessageFor(model => model.MobilePhoneNumber)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Tilbake", "../Home")
</div>
